/** 
 * 文件名：MaxTemperature.java 
 * 版本信息： 
 * 日期：Jun 3, 2010 
 * Copyright SafeCenterTeam@renren.com	2010 
 * 版权所有 
 * 
 */
package com.xiaonei.hadoop;

import java.io.IOException;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;

/**
 * 项目名称：ice-test <br>
 * 类名称：MaxTemperature <br>
 * 类描述： <br>
 * 创建人：liushaohui <br>
 * 创建时间：Jun 3, 2010 4:24:47 PM <br>
 * 修改人：liushaohui <br>
 * 修改时间：Jun 3, 2010 4:24:47 PM <br>
 * 修改备注： <br>
 * 
 * @version
 */
public class MaxTemperature {

    public static void main(String[] args) throws IOException {

        if (args.length != 2) {
            System.err.println("Usage : MaxTemperature <input path> <output path>");
            System.exit(-1);
        }

        JobConf jobConf = new JobConf(MaxTemperature.class);
        jobConf.setJobName("Max Temperature");

        FileInputFormat.addInputPath(jobConf, new Path(args[0]));
        FileOutputFormat.setOutputPath(jobConf, new Path(args[1]));

        jobConf.setMapperClass(MaxTemperatureMapper.class);
        jobConf.setReducerClass(MaxTemperatureReducer.class);

        jobConf.setOutputKeyClass(Text.class);
        jobConf.setOutputValueClass(IntWritable.class);

        JobClient.runJob(jobConf);
    }
}
